package com.atguigu.jedispool;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * Created by Smexy on 2022/10/4
 */
public class Demo4JedisPool
{
    public static void main(String[] args) {

        JedisPool jedisPool = new JedisPool("hadoop102", 6379);

        //从池中中借一个连接
        Jedis jedis = jedisPool.getResource();

        System.out.println(jedis.ping());

        //把连接还回池子
        jedis.close();

        jedisPool.close();

    }
}
